1. Field of the Invention
The present invention is directed to the field of computer-implemented database transaction management. It is more particularly directed to efficiently extending database transaction semantics to include user-defined operations.
2. Description of the Background Art
A computer-implemented database is a collection of data, organized in the form of tables. A table typically consists of columns that represent data of the same nature, and records that represent specific instances of data associated with the table. A relational database is a database that may be a set of tables containing information that is manipulated in accordance with the relational model associated with the data. For example, the product marketed under the trademarks IBM DB2 stores the data associated with the database in tables, and each table has a name. It will be appreciated that other vendors also provide databases, including relational databases.
Many databases enable users to extend database operations with user -customizable features. Examples of such extensibility mechanisms include user-defined functions and operations, stored procedures, extenders, blades, wrappers, and connectors. Such extensibility mechanisms will be referred to herein as user-defined operations. Such user-defined operations may be implemented by program code used to perform tasks that are specific to applications that operate in conjunction with databases such as data computations and transformations, and to retrieve data from external sources. The user-defined operations are often tightly coupled with the database, and typically may be executed as part of normal database operations such as queries and updates, and performed on data managed by the database before it is returned to the application. This tightly coupled execution model is crucial to ensuring high performance execution of data-intensive database applications.
A transaction is a unit of work that often changes data and that is typically created by operations associated with a database application program. A transaction typically includes execution of an application program specified sequence of operations that are initiated with a begin transaction operation, that include one or more update or read access operations, and that end with either a commit or a rollback operation. Database transactions associated with highly critical database applications operate reliably by ensuring that transactions are completely performed when committed or fully rolled back if an error occurs during the operation of the transaction. User-defined operations may perform updates, so it is desirable to be able to extend the operation of database transactions to include the user-defined operations.
A highly reliable transaction typically includes the following features that ensure reliable updates of the associated data: atomicity, consistency, isolation, and durability (ACID). Atomicity ensures that the results of a transaction are treated as a unit and either completed or backed out as a unit, either by a data commit or roll back operation. Those skilled in the art will appreciate the data commit operation and the data roll back operation. Atomicity is typically implemented by a single-phase commit protocol in a non-distributed database environment and by a two-phase commit protocol in a distributed database environment. The two-phase commit protocol typically probes the computer-related resources associated with the transaction to ensure they are ready to commit and only commits the transaction if all resources are ready to commit. Consistency ensures that the transaction changes data from one valid state to another valid state. Isolation ensures that intermediate changes to the data that occur during the transaction operation are not accessible until the transaction has completed a data commit operation. Durability ensures that intermediate changes to the data that occur during the transaction survive subsequent computer-system failures.
While most database products do not extend transaction semantics to user-defined operations, the IBM DB2 product does enable such extended transaction semantics through integration with the Resource Recovery Services Transaction Control Facility embedded in the operating system marketed under the trademark Z/OS®. This integration enables user-defined operations to commit and rollback through the database, but not as part of the database transaction, and relies on a proprietary solution.
It would be useful for database products to extend non-proprietary highly reliable database transaction semantics, such as computer transaction protocols, to include user -defined operations that access resources external to the database (“external resources”). More particularly it would be useful if user-defined operations operated in existing, well -defined, highly reliable, industry standard database transaction protocol semantics that support atomicity. From the foregoing it will be apparent that there is still a need to improve the techniques associated with highly reliable transaction protocol semantics that support user-defined operations and that are in databases.